<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('离疆申请流程状态对象列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <!--<div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>审批人名称：</label>
                                <input type="text" name="sprMc"/>
                            </li>
                            <li>
                                <label>审批人id：</label>
                                <input type="text" name="sprId"/>
                            </li>
                            <li>
                                <label>流程状态：</label>
                                <select name="lczt" th:with="type=${@dict.getType('b_spzt')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li class="select-time">
                                <label>审批时间：</label>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginSpsj]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endSpsj]"/>
                            </li>
                            <li>
                                <label>业务对象类型：</label>
                                <select name="ywdxType">
                                    <option value="">所有</option>
                                    <option value="-1">代码生成请选择字典属性</option>
                                </select>
                            </li>
                            <li>
                                <label>业务对象id：</label>
                                <input type="text" name="ywdxId"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>-->

            <div class="btn-group-sm" id="toolbar" role="group">
                <!--<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="sp:process:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="sp:process:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="sp:process:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>-->
                <!--<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="sp:process:export">-->
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="lwsq:lwsq:export">
                    <i class="fa fa-download"></i> 导出申请信息
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('sp:process:edit')}]];
        var removeFlag = [[${@permission.hasPermi('sp:process:remove')}]];
        var lcztDatas = [[${@dict.getType('b_spzt')}]];
        var rylxDatas = [[${@dict.getType('b_rylx')}]];
        var yesOrNoDatas = [[${@dict.getType('sys_yes_no')}]];
        var zzslxDatas = [[${@dict.getType('b_zzslx')}]];
        var jtfsDatas = [[${@dict.getType('b_jtfs')}]];

        var prefix = ctx + "sp/process";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                /*exportUrl: prefix + "/export",*/
                exportUrl: ctx + "lwsq/lwsq" + "/export",
                modalName: "离疆申请流程状态对象",
                showSearch:false,
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: 'null',
                    visible: false
                },
                {
                    field: 'applicationInfo.xm',
                    title: '申请人',
                },
                {
                    field: 'applicationInfo.mz',
                    title: '民族',
                },
                {
                    field: 'applicationInfo.sfjn',
                    title: '人员类型',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(rylxDatas, value);
                    }
                },
                {
                    field: 'applicationInfo.styc',
                    title: '是否有症状',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(yesOrNoDatas, value);
                    }
                },
                {
                    field: 'applicationInfo.rwrq',
                    title: '入乌日期'
                },
                {
                    field: 'applicationInfo.zzslx',
                    title: '暂住所类型',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(zzslxDatas, value);
                    }
                },
                {
                    field: 'applicationInfo.sqName',
                    title: '所属社区'
                },
                {
                    field: 'applicationInfo.lwfs',
                    title: '离乌方式',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(jtfsDatas, value);
                    }
                },
                {
                    field: 'applicationInfo.yqlwrq',
                    title: '预期离乌日期'
                },
                {
                    field: 'applicationInfo.fcmdd',
                    title: '返程目的地'
                },
                {
                    field: 'applicationInfo.hsjc',
                    title: '具有核酸检测报告',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(yesOrNoDatas, value);
                    }
                },
                {
                    field: 'sprMc',
                    title: '审批人名称',
                    visible: false
                },
                {
                    field: 'sprId',
                    title: '审批人id',
                    visible: false
                },
                {
                    field: 'lczt',
                    title: '流程状态',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(lcztDatas, value);
                    }
                },
                {
                    field: 'clyj',
                    title: '处理意见',
                    visible: false
                },
                {
                    field: 'spsj',
                    title: '审批时间',
                    visible: false
                },
                {
                    field: 'ywdxType',
                    title: '业务对象类型',
                    visible: false
                },
                {
                    field: 'ywdxId',
                    title: '业务对象id',
                    visible: false
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        console.log("fx_out:"+JSON.stringify(row));
                        if(row.lczt=="SPZ"){
                            actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>审批</a> ');
                        }
                        /*actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>')*/;
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>